home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 151-175 / disk_152 / blk / pro.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  1KB  |  71 lines

  1. #include <stdio.h>
  2. #include <functions.h>
  3. #include <exec/types.h>
  4. #include <intuition/intuition.h>
  5.  
  6. #define OK_ID  0x80
  7. #define CAN_ID 0x81
  8. #define STR_ID 0x82
  9. #define NUMCHR 20
  10. struct TextAttr ta = { (UBYTE*)"topaz.font",8,0,0 };
  11. UBYTE undo[NUMCHR];
  12.  
  13. #define REQ mot_req
  14. #include "prototype.h"
  15.  
  16.  
  17. struct NewWindow nwin = {
  18.    0,0,300,150,
  19.    -1,-1,GADGETUP|GADGETDOWN|REQCLEAR|MOUSEMOVE,
  20.    WINDOWDEPTH|WINDOWDRAG|SMART_REFRESH,
  21.    NULL,NULL,(UBYTE*)"Blocks",NULL,
  22.    NULL,0,0,0,0,WBENCHSCREEN
  23. };
  24.  
  25. struct IntuitionBase *IntuitionBase;
  26.  
  27.  
  28. main(argc,argv)
  29.    int argc;
  30.    char *argv[];
  31. {
  32.    struct Window *win;
  33.  
  34.    IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0L);
  35.    if (IntuitionBase) {
  36.       nwin.Width = REQ.Width + 10;
  37.       nwin.Height = REQ.Height + 14;
  38.       win = OpenWindow (&nwin);
  39.       if (win) {
  40.          Body (win);
  41.          CloseWindow (win);
  42.       }
  43.       CloseLibrary (IntuitionBase);
  44.    }
  45. }
  46.  
  47.  
  48.  
  49. Body(win)
  50.    struct Window *win;
  51. {
  52.    struct IntuiMessage *im;
  53.    BOOL looping=TRUE;
  54.    ULONG class;
  55.  
  56.    REQ.LeftEdge = 5;
  57.    REQ.TopEdge = 12;
  58.    Request (&REQ,win);
  59.  
  60.    while (looping) {
  61.       im = (struct IntuiMessage *) GetMsg(win->UserPort);
  62.       if (!im) WaitPort (win->UserPort);
  63.        else {
  64.          printf ("Message: %lx\n", im);
  65.          class = im->Class;
  66.          ReplyMsg (im);
  67.          if (class == REQCLEAR) looping = FALSE;
  68.        }
  69.    }
  70. }
  71.